export const optionList: any[] = [
  {
    title: '项目申请',
    children: [
      {
        label: '意向申请',
        bgColor: '#dbf1e1',
        borderColor: '#19be6b',
        value: 1,
        routerName: 'projectApplication',
        labelValueList: [
          {
            label: '项目编号',
            prop: 'businessNo',
          },
          {
            label: '申办方',
            prop: 'businessOrgName',
          },
          {
            label: '专业/主要研究者',
            prop: 'businessSubName',
          },
        ],
      },
      {
        label: '立项申请',
        bgColor: '#dbf1e1',
        borderColor: '#19be6b',
        value: 2,
        labelValueList: [
          {
            label: '项目编号',
            prop: 'businessNo',
          },
          {
            label: '申办方',
            prop: 'businessOrgName',
          },
          {
            label: '专业/主要研究者',
            prop: 'businessSubName',
          },
        ],
      },
    ],
  },
  {
    title: '任务审批',
    children: [
      {
        label: '任务审批',
        bgColor: '#ecf5ff',
        borderColor: '#2979ff',
        value: 3,
        routerName: 'taskDetails',
        labelValueList: [
          {
            label: '项目编号',
            prop: 'projectNo',
          },
          {
            label: '任务责任人',
            prop: 'businessSubName',
          },
        ],
      },
    ],
  },
  {
    title: '电子签署',
    children: [
      {
        label: '电子签署',
        bgColor: '#ecf5ff',
        borderColor: '#2979ff',
        value: 17,
        labelValueList: [
          {
            label: '项目编号',
            prop: 'businessNo',
          },
          {
            label: '申办方',
            prop: 'businessOrgName',
          },
        ],
      },
    ],
  },
  {
    title: '财务待办',
    children: [
      {
        label: '合同管理',
        bgColor: '#fef0f0',
        borderColor: '#fa3534',
        value: 4,
        labelValueList: [
          {
            label: '项目编号',
            prop: 'projectNo',
          },
          {
            label: '委托方',
            prop: 'businessOrgName',
          },
        ],
      },
      {
        label: '经费入账',
        bgColor: '#fef0f0',
        borderColor: '#fa3534',
        value: 5,
        labelValueList: [
          {
            label: '项目编号',
            prop: 'projectNo',
          },
          {
            label: '付款方',
            prop: 'businessOrgName',
          },
          {
            label: '付款金额',
            prop: 'businessSubName',
          },
        ],
      },
      {
        label: '经费支出',
        bgColor: '#fef0f0',
        borderColor: '#fa3534',
        value: 6,
        labelValueList: [],
      },
      {
        label: '经费调整',
        bgColor: '#fef0f0',
        borderColor: '#fa3534',
        value: 7,
        labelValueList: [],
      },
    ],
  },
  {
    title: '质控待办',
    children: [
      {
        label: '质控计划',
        bgColor: '#fdf6ec',
        borderColor: '#f90',
        value: 8,
        labelValueList: [],
      },
      {
        label: '质控预约',
        bgColor: '#fdf6ec',
        borderColor: '#f90',
        value: 9,
        labelValueList: [],
      },
      {
        label: '质控报告',
        bgColor: '#fdf6ec',
        borderColor: '#f90',
        value: 10,
        labelValueList: [],
      },
      {
        label: '问题跟踪',
        bgColor: '#fdf6ec',
        borderColor: '#f90',
        value: 11,
        labelValueList: [],
      },
    ],
  },
  {
    title: '访视待办',
    children: [
      {
        label: '访视待办',
        bgColor: '#f5b4d2',
        borderColor: '#ea5099',
        value: 12,
        labelValueList: [],
      },
    ],
  },
  {
    title: '受试者安全待办',
    children: [
      {
        label: 'SAE',
        bgColor: '#a4d7d7',
        borderColor: '#00a098',
        value: 13,
        labelValueList: [],
      },
      {
        label: 'SUSAR',
        bgColor: '#a4d7d7',
        borderColor: '#00a098',
        value: 14,
        labelValueList: [],
      },
      {
        label: 'DSUR',
        bgColor: '#a4d7d7',
        borderColor: '#00a098',
        value: 15,
        labelValueList: [],
      },
    ],
  },
  {
    title: '伦理待办',
    children: [
      {
        label: '伦理待办',
        bgColor: '#9fd8f6',
        borderColor: '#00a0ea',
        value: 16,
        labelValueList: [],
      },
    ],
  },
];

// 将待办类型转换成map对象
export const getTodoListMap = (optionList: any[]) => {
  let TodoListMap: any = {};
  for (let i = 0; i < optionList.length; i++) {
    if (optionList[i].value) {
      TodoListMap[optionList[i].value] = optionList[i];
    } else if (optionList[i].children.length) {
      TodoListMap = Object.assign(
        TodoListMap,
        getTodoListMap(optionList[i].children)
      );
    }
  }
  return TodoListMap;
};
